#!/usr/bin/env python

from tori.settings import ezarpenak
import optparse
import tori.parser
import gettext
_=gettext.gettext


ezarpenak = ezarpenak()

BERTSIOA   = '0.1'
IZENA      = 'Torias: Tori Assembler'
DISCLAIMER = 'This program is at developement stage \
and comes with ABSOLUTELY NO WARRANTY'

erabilera = _('Usage: %prog [OPTION]... [FILE]...')
argpars = optparse.OptionParser(usage=erabilera)

argpars.add_option('-v', '--version', dest='version', default=False,
    action='store_true', help=_('show version information and exit'))


(auk, arg) = argpars.parse_args()


if len(arg) < 1:
    print _('Ez da fitxategirik adierazi.')
    print _('Erabili -h aukera erabilera ikusteko.')
else:
    parser = tori.parser.parser(ezarpenak)
    for i in arg:
        f = open(i,'r')
        parser.parse(f)
        f.close()
        parser.bin(open(i+'.out','w'))

